exports.getOpenId = function(req, res) {

	//获取restful参数
	var restfulParams = req.routeInfo.restfulParams;

	//code
	var code = restfulParams.code;

	//最终结果
	var resultData = {};

	//任务流创建
	async.waterfall([


		//获取用户临时openid
		(cb) => {
			var openidUrl = "http://"+config.publicConfig.SERVER_IP+"/weixinDemo_CRM/getUserAccessToken.php?code=" + code;
			R.SEND_HTTP(
				req,
				res, {
					url: openidUrl,
					method: 'GET'
				},
				function(err, data) {

					console.log('临时openid');
					console.log(data);
					console.log(err);

					if(err.result.errmsg) {
						return RES.errorResponse(res, err.result.errmsg);
					}

					resultData = err.result;

					cb();

				}
			);

		},

	],  () => {

		//返回最终拼接结果
		RES.successResponse(res, resultData);

	});

}